import request from '@/utils/request'

enum API {
    TRADEMARKLIST = '/admin/product/baseTrademark/',
    ADDSKU = '/admin/product/baseTrademark/save',
    UPDATETRADEMARK = '/admin/product/baseTrademark/update',
    DELETETRADEMARK='/admin/product/baseTrademark/remove/'
}
import type { trademarkResponseData, trademark } from './model/trademark'
// 商品数据接口
export const reqtrademarklist = (page: number, limit: number) => request.get<any, trademarkResponseData>(API.TRADEMARKLIST + `${page}/${limit}`)

// 添加或修改商品
export const reqAddOrUpdateTradeMark = (data: trademark) => {
    if (data.id) {
        return request.put<any, any>(API.UPDATETRADEMARK,data)
    } else {
        return request.post<any, any>(API.ADDSKU,data)
    }
}

// 删除
export const reqDeleteTrademark=(id:number)=>request.delete<any,any>(API.DELETETRADEMARK+`${id}`)